{
 "cells": [
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Cost Minimization\n",
    "\n",
    "Below we start with a basic example of a hybrid variational algorithm which involves flipping the Bloch vector of a qubit from the $\\ket{0}$ to the $\\ket{1}$ state. First we import the relevant packages and set our backend to simulate our workflow on NVIDIA GPUs. \n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import cudaq\n",
    "from typing import List\n",
    "\n",
    "cudaq.set_target(\"nvidia\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "     ╭───────╮╭───────╮\n",
      "q0 : ┤ rx(0) ├┤ ry(0) ├\n",
      "     ╰───────╯╰───────╯\n",
      "\n"
     ]
    }
   ],
   "source": [
    "# Initialize a kernel/ ansatz and variational parameters.\n",
    "@cudaq.kernel\n",
    "def kernel(angles: List[float]):\n",
    "    # Allocate a qubit that is initialized to the |0> state.\n",
    "    qubit = cudaq.qubit()\n",
    "    # Define gates and the qubits they act upon.\n",
    "    rx(angles[0], qubit)\n",
    "    ry(angles[1], qubit)\n",
    "\n",
    "\n",
    "# Our Hamiltonian will be the Z expectation value of our qubit.\n",
    "hamiltonian = cudaq.spin.z(0)\n",
    "\n",
    "# Initial gate parameters which intialize the qubit in the zero state\n",
    "initial_parameters = [0, 0]\n",
    "\n",
    "print(cudaq.draw(kernel, initial_parameters))"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We build our cost function such that its minimal value corresponds to the qubit being in the $\\ket{1}$ state. The observe call below allows us to simulate our statevector $\\ket{\\psi}$, and calculate $\\bra{\\psi}Z\\ket{\\psi}$.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "cost_values = []\n",
    "\n",
    "\n",
    "def cost(parameters):\n",
    "    \"\"\"Returns the expectation value as our cost.\"\"\"\n",
    "    expectation_value = cudaq.observe(kernel, hamiltonian,\n",
    "                                      parameters).expectation()\n",
    "    cost_values.append(expectation_value)\n",
    "    return expectation_value"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "1.0\n"
     ]
    }
   ],
   "source": [
    "# We see that the initial value of our cost function is one, demonstrating that our qubit is in the zero state\n",
    "initial_cost_value = cost(initial_parameters)\n",
    "print(initial_cost_value)"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Below we use our built-in optimization suite to minimize the cost function. We will be using the gradient-free COBYLA alogrithm. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Define a CUDA-Q optimizer.\n",
    "optimizer = cudaq.optimizers.COBYLA()\n",
    "optimizer.initial_parameters = initial_parameters\n",
    "\n",
    "result = optimizer.optimize(dimensions=2, function=cost)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "tags": [
     "nbsphinx-thumbnail"
    ]
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "Text(0, 0.5, 'Cost Value')"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAksAAAGwCAYAAAC5ACFFAAAAOnRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjEwLjAsIGh0dHBzOi8vbWF0cGxvdGxpYi5vcmcvlHJYcgAAAAlwSFlzAAAPYQAAD2EBqD+naQAAS7hJREFUeJzt3XtcVGX+B/DPmQGGi1yFmQFFwUsq5S1NQs0uEKDWRrm7UpaXNV1N3QxLpVVJrey25lb+Mk3TNs2y1e6xKV4qQy3MW6GpaagwICIMF7nNnN8fMEcnYLg4cM4wn/frN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gGeeeQYXL17ErFmz8Mgjj0Cn0wEAnnnmGUybNg1arRYjR45EcXEx9u7di1mzZjWpvkWLFmHQoEG48cYbUVFRgc8//1wKa0SkbAxLRNQupKamIjg42Gpbr169cPz4cQA1d6pt3rwZjz32GIKDg/H+++8jIiICAODp6Yn//e9/ePzxx3HLLbfA09MTY8aMwfLly6VzTZgwAeXl5Xj11Vfx5JNPIjAwEH/+85+bXJ+bmxuSk5Nx9uxZeHh44LbbbsPmzZvt8M6JqLUJoiiKchdBRNSaBEHAtm3bkJCQIHcpROSAOGaJiIiIyAaGJSIiIiIbOGaJiNo9jjYgouvBzhIRERGRDQxLRERERDYwLBERERHZwLBEREREZAPDEhEREZENDEtERERENjAsEREREdnAsERERERkw/8DTjlpQHh72fEAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 640x480 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Plotting how the value of the cost function decreases during the minimization procedure.\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "x_values = list(range(len(cost_values)))\n",
    "y_values = cost_values\n",
    "\n",
    "plt.plot(x_values, y_values)\n",
    "\n",
    "plt.xlabel(\"Epochs\")\n",
    "plt.ylabel(\"Cost Value\")"
   ]
  },
  {
   "attachments": {},
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We see that the final value or our cost function, $\\bra{\\psi}Z\\ket{\\psi} = -1$ demonstrating that the qubit is in the $\\ket{1}$ state."
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  },
  "vscode": {
   "interpreter": {
    "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
